let app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
	  ID: '',
	  main_service: '',
	  service_contents: [],
	  service_type: '',
	  start_time: '',
	  end_time: '',
	  work_year: '',
	  zz_require: '',
	  js_require: '',
	  age_require: '',
	  min_price: 0,
	  max_price: 0,
	  create_time: '',
	  service_address: '',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
	new app.ToastPannel();
	var that = this
	var key = wx.getStorageSync('key')
	var uid = wx.getStorageSync('u')
	var id = options.id || options.goods_id
	wx.request({
	  url: app.configData.shop.api_url + '/index.php?ctl=Service_Require&met=requireDetail&typ=json',
	  data: { k: key, u: uid, id: id },
	  method: 'GET', 
	  header: {
	    "Content-Type": "application/json"
	  }, // 设置请求的 header
	  success: function (res) {
	    
	    var require_info = res.data.data.require_detail
	    if(res.data.status == 200){
	        that.setData({
				ID: require_info.id,
				main_service: require_info.main_service,
				service_contents: require_info.service_contents,
				service_type: require_info.service_type,
				start_time: require_info.start_time,
				end_time: require_info.end_time,
				work_year: require_info.work_year,
				zz_require: require_info.zz_require,
				js_require: require_info.js_require,
				age_require: require_info.age_require,
				min_price: require_info.min_price,
				max_price: require_info.max_price,
				create_time: require_info.create_time,
				service_address: require_info.service_address,
	        })
	    }
	  },
	  fail: function (res) {
	    that.show('数据加载失败')
	  }
	})
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})